package java06;

public class 数组反转 {
    public static void main(String[] args) {
        int[] arr={11,22,33,44,55,66};
        changeArr(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    public static void changeArr(int[] arr){
        for (int i = 0; i < arr.length/2; i++) {
            arr[i]=arr[i]^arr[arr.length-i-1];
            arr[arr.length-1-i] = arr[i]^arr[arr.length-i-1];
            arr[i] = arr[i]^arr[arr.length-1-i];
        }
    }
}
